home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 10 / q10.d81 / t.control80 demo < prev    next >
Text File  |  2022-08-28  |  14KB  |  313 lines

  1.                              C O N T R O L    8 0
  2.  
  3.                                 By Jon Mattson
  4.  
  5.      One of the greatest advantages of upgrading from a C-64 to a C-128 has
  6. got to be the 80-column RGB capability.  The improved resolution of the 8563
  7. chip puts the 128 on par with its much more expensive rivals from a graphics
  8. point of view.  Text displays, such as those used in word processors,
  9. benefit tremendously from the extra screen capacity, allowing the 128 to be
  10. used as a serious work machine.  For the not-so-serious, adventure games and
  11. the like can also take advantage of this extra space.  Then, too, there are
  12. all sorts of nifty graphic tricks that can be produced with the 8563.
  13.  
  14.      Unfortunately, 'tricks' might well be the operative word in that last
  15. paragraph.  If you have tried programming the 8563 at all, you probably
  16. discovered early on that it was no task to be taken lightly.  Using it at
  17. all can be quite a sleight of hand trick, in itself.  Since the chip has
  18. only a two byte 'window' into the 128's normal memory, even apparently
  19. simple tasks can be daunting.  Machine language knowledge is a virtual
  20. necessity for speedy graphics, since BASIC 7.0 virtually ignores the chip's
  21. existence.  Even the tried and true POKE and PEEK don't work!  Thus, if you
  22. aren't an ML wizard with a Programmer's Reference Guide, you probably had to
  23. content yourself with PRINT and the occasional SYS to ROM tricks.
  24.  
  25.      That was until now.  CONTROL 80 changes all of that by adding 18 new
  26. keywords to BASIC 7.0: 16 commands and 2 functions that give you full and
  27. easy access to the 8563.
  28.  
  29.      Using C80 is simple.  Just BLOAD it into memory and SYS 4864, either in
  30. direct mode or early on in your program.  If you are in direct mode, a
  31. message will inform you that it is installed.  This message will not appear
  32. from within a program, however, since it might ruin your screen
  33. presentation.  Generally, a simple BLOAD will suffice, but if you have been
  34. playing around with BANKs and the like, you might want to use the full
  35. syntax: BLOAD "CONTROL80",B0,P4864.
  36.  
  37.      Once C80 is installed, the new keywords can be used just like any other
  38. BASIC commands.  You can even abbreviate them by shifting the second letter,
  39. as usual.  Remember that C80 must be active (not just resident) while you
  40. type in a program using its keywords, or they will not be tokenized
  41. correctly.  Note also that C80 uses memory from 4864 to 6629 (only), so
  42. avoid POKEing around this area.
  43.  
  44.      Hitting the beloved STOP/RESTORE combination will not deactivate C80. 
  45. The QUIT command (previously unimplemented on the 128) will turn it off,
  46. although SYS 4864 will bring it back to life.  Resetting the computer will
  47. also turn it off; however, due to its location, C80 will still be resident
  48. for later use as long as you haven't POKEd over its memory space.
  49.  
  50.      Now let's take a look at your new resources.  Certain conventions have
  51. been followed in this listing.  Memory addresses are 0-65535, as usual, to
  52. allow use with both 16K and 64K VDCs.  Note, however, that addresses above
  53. 16383 wrap around on the 16K chip (i.e.  16384 = 0).  Remember that the
  54. basic 8563 chip is set up as follows:
  55.  
  56.        $0000 - 07FF       0 - 2047    Screen
  57.        $0800 - 0FFF    2048 - 4095    Attribute
  58.        $1000 - 1FFF    4096 - 8191    Unused
  59.        $2000 - 2FFF    8192 - 12287   Upper Case/Graphic Char Set
  60.        $3000 - 3FFF   12288 - 16383   Lower/Upper Case Char Set
  61.  
  62.      VDC register numbers (reg# below) range from 0-36.  While it is not
  63. within the scope of this article to explain the use of every register, a
  64. simplified table listing each one will be given in the Appendix.  A more
  65. complete description can be found in the C-128 Programmer's Reference Guide
  66. and many other sources.  When in doubt, experiment with WVD - just be sure
  67. that you check the registers normal value with RVD first to set things back
  68. to normal!
  69.  
  70.                               ***  FUNCTIONS  ***
  71.  
  72. PEER (VDC address)
  73.  
  74.      This function allows you to check the contents of VDC memory.  It
  75. operates just like BASIC's PEEK.  For example, to find the character in the
  76. top left corner of the screen: PRINT PEER(0).  Note that PEER is the
  77. counterpart of POST, below.
  78.  
  79. RVD (reg#)
  80.  
  81.      This function (Read ViDeo register) allows you to check the contents of
  82. any of the 37 VDC registers.  For example, A=RVD(12) would put the contents
  83. of register 12 in A.  Note that RVD is the counterpart of WVD, below.
  84.  
  85.                               ***  COMMANDS  ***
  86.  
  87. BLOCK VDC address, number, value
  88.  
  89.      This command is similar to FILL, below, except that it allows you to
  90. fill ANY small section of VDC memory with a single value.  "Address"
  91. indicates the starting position of the fill, and "number" (2-255) indicates
  92. how many locations to fill with the specified "value" (0-255) from that
  93. point on.  One of the best uses of BLOCK is to highlight a line on the
  94. screen by filling attribute memory with a different color value and/or
  95. reverse.  For example, BLOCK 2048,80,72 would highlight the entire first
  96. line of the screen by coloring it red and using reverse characters.
  97.  
  98. DUMP type
  99.  
  100.      This command dumps the entire 80 column screen display to any Commodore
  101. compatible printer.  Remember that the 8563 allows two character sets on the
  102. screen at the same time, but your printer will not: it will print the entire
  103. screen with the character set specified.  "Type" may be either 0 for an
  104. upper case/graphics dump or 7 for a lower/upper case dump.  These correspond
  105. to the normal and alternate character sets, respectively, in VDC terms.  If
  106. you must access DUMP in direct mode, remember that you can use ESCAPE-X to
  107. move to the 40-column screen and type the command there.
  108.  
  109. FCOPY address, bank, character set
  110.  
  111.      This command allows you to convert and copy a standard 40-column font
  112. already in normal memory at the "address" and "bank" specified to the 8563
  113. chip.  Since the 8563 allows two character sets simultaneously, you must
  114. specify which one to replace: 0 for upper case/graphics or 1 for lower/upper
  115. case.  For example, if you wanted to replace the uc/g set with your font,
  116. you might enter the following:
  117.  
  118.                     BLOAD "font",B0,P14336:FCOPY 14336,0,0
  119.  
  120.      Note that you cannot simply VLOAD the font into 8563 memory, as the two
  121. formats are different and require conversion.  Once the font has been
  122. FCOPYed into the VDC, you could VSAVE that, but it is actually less
  123. efficient this way, taking up twice as much disk space and, thus, twice as
  124. much loading time.  Stick with FCOPY if at all possible.
  125.  
  126. FILL screen type, value
  127.  
  128.      This command allows you to fill either screen ("type" 0) or attribute
  129. ("type" 1) memory with a single "value" from 0-255.  Screen codes are as per
  130. usual.  Attribute codes include color, reverse, flash and the like:
  131.  
  132.      Bit 7 (128)  Alternate Character Set
  133.          6 (64)   Reverse Video
  134.          5 (32)   Underline
  135.          4 (16)   Flash
  136.          3 (8)    Red
  137.          2 (4)    Green
  138.          1 (2)    Blue
  139.          0 (1)    Intensity
  140.  
  141.      For example, FILL 1,154 will cause all characters to turn purple, flash
  142. and use the alternate character set.
  143.  
  144. FINIT
  145.  
  146.      This command simply reinitializes the 8563's normal fonts.  It is
  147. useful for cancelling the effects of FCOPY or undesirable POSTs into
  148. character memory.
  149.  
  150. HOME
  151.  
  152.      Homes the cursor within the current window.
  153.  
  154. LCLEAR first line, last line
  155.  
  156.      This command clears the indicated lines (0-24), including any unusual
  157. attribute effects such as flash and the like.  Naturally, the last line must
  158. ba hiahea than or equal to the value of the first.  Note that linesaare only
  159. cleared within the boundaries of theacurrent window, and the line values
  160. will be offset by the position of the window from the real top of the
  161. screen.  Thus, the 0-24 range assumes a full-screen window and will be
  162. smaller for smaller windows.
  163.  
  164. POST VDC address, value
  165.  
  166.      This command allows you to place values into 8563 memory.  It operates
  167. just like BASIC's POKE.  For example, POST 0,1 will place an "A" in the top
  168. left corner of the screen.  Note that POST is the counterpart of PEER.
  169.  
  170. RECALL bytes, VDC address, from RAM address, from bank
  171.  
  172.      Thi